package com.brzjomo.secretiveworld.init;

import com.brzjomo.secretiveworld.SecretiveWorld;
import com.brzjomo.secretiveworld.object.block.CorpseOfAnUnknownTravelerBlock;
import com.brzjomo.secretiveworld.object.block.CrateBlock;
import com.brzjomo.secretiveworld.object.block.DryNetBlock;
import com.brzjomo.secretiveworld.object.block.FloatingBridgeBlock;
import com.brzjomo.secretiveworld.object.block.GlowGlassBlock;
import com.brzjomo.secretiveworld.object.block.GlowStainedGlassBlock;
import com.brzjomo.secretiveworld.object.block.GreedyChestBlock;
import com.brzjomo.secretiveworld.object.block.LaurelLeafBlock;
import com.brzjomo.secretiveworld.object.block.ModLogBlock;
import com.brzjomo.secretiveworld.object.block.ModSaplingBlock;
import com.brzjomo.secretiveworld.object.block.PerforatedBlock;
import com.brzjomo.secretiveworld.object.block.SlopeBlock;
import com.brzjomo.secretiveworld.object.block.StoneBrazierBlock;
import com.brzjomo.secretiveworld.object.block.StonePillarBlock;
import com.brzjomo.secretiveworld.object.block.tree.LaurelTree;

import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.OreBlock;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialColor;
import net.minecraft.item.DyeColor;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

public class ModBlocks {
	@SuppressWarnings("deprecation")
	public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS,
			SecretiveWorld.MODID);

	// Ore_Blocks
	public static final RegistryObject<Block> COPPER_ORE = BLOCKS.register("copper_ore",
			() -> new OreBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(4.0F, 10.0F)
					.harvestTool(ToolType.PICKAXE).harvestLevel(1)));

	public static final RegistryObject<Block> SILVER_ORE = BLOCKS.register("silver_ore",
			() -> new OreBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 10.0F)
					.harvestTool(ToolType.PICKAXE).harvestLevel(2)));

	public static final RegistryObject<Block> COPPER_BLOCK = BLOCKS.register("copper_block",
			() -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(4.0F, 3.0F)
					.sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(1)));

	public static final RegistryObject<Block> SILVER_BLOCK = BLOCKS.register("silver_block",
			() -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F)
					.sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(2)));

	public static final RegistryObject<Block> MITHRIL_BLOCK = BLOCKS.register("mithril_block",
			() -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(6.0F, 3.0F)
					.sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(3)));

	// Interactive_Blocks
	public static final RegistryObject<Block> DRY_NET = BLOCKS.register("dry_net",
			() -> new DryNetBlock(Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F, 4.0F)
					.sound(SoundType.WOOD).harvestTool(ToolType.AXE).harvestLevel(0)));

	// Building_Blocks
	public static final RegistryObject<Block> STONE_BRAZIER = BLOCKS.register("stone_brazier",
			() -> new StoneBrazierBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 10.0F)
					.harvestTool(ToolType.PICKAXE).harvestLevel(0).sound(SoundType.STONE).lightValue(15)));

	public static final RegistryObject<Block> STONE_PILLAR = BLOCKS.register("stone_pillar",
			() -> new StonePillarBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 10.0F)
					.harvestTool(ToolType.PICKAXE).harvestLevel(0).sound(SoundType.STONE)));

	public static final RegistryObject<Block> BRICK_SLOPE = BLOCKS.register("brick_slope",
			() -> new SlopeBlock(null, Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 10.0F)
					.harvestTool(ToolType.PICKAXE).harvestLevel(0).sound(SoundType.STONE)));

	public static final RegistryObject<Block> STONEBRICK_SLOPE = BLOCKS.register("stonebrick_slope",
			() -> new SlopeBlock(null, Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 10.0F)
					.harvestTool(ToolType.PICKAXE).harvestLevel(0).sound(SoundType.STONE)));

	public static final RegistryObject<Block> FLOATING_BRIDGE = BLOCKS.register("floating_bridge",
			() -> new FloatingBridgeBlock(Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F, 4.0F)
					.sound(SoundType.WOOD).harvestTool(ToolType.AXE).harvestLevel(0)));

	public static final RegistryObject<Block> GLOW_GLASS = BLOCKS.register("glow_glass",
			() -> new GlowGlassBlock(Block.Properties.create(Material.GLASS).hardnessAndResistance(0.3F)
					.sound(SoundType.GLASS).notSolid().lightValue(11)));

	public static final RegistryObject<Block> GLOW_WHITE_STAINED_GLASS = BLOCKS.register("glow_white_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.WHITE, Block.Properties.create(Material.GLASS, DyeColor.WHITE)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_ORANGE_STAINED_GLASS = BLOCKS.register("glow_orange_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.ORANGE, Block.Properties.create(Material.GLASS, DyeColor.ORANGE)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_MAGENTA_STAINED_GLASS = BLOCKS.register("glow_magenta_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.MAGENTA, Block.Properties.create(Material.GLASS, DyeColor.MAGENTA)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_LIGHT_BLUE_STAINED_GLASS = BLOCKS.register("glow_light_blue_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.LIGHT_BLUE, Block.Properties.create(Material.GLASS, DyeColor.LIGHT_BLUE)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_YELLOW_STAINED_GLASS = BLOCKS.register("glow_yellow_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.YELLOW, Block.Properties.create(Material.GLASS, DyeColor.YELLOW)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_LIME_STAINED_GLASS = BLOCKS.register("glow_lime_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.LIME, Block.Properties.create(Material.GLASS, DyeColor.LIME)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_PINK_STAINED_GLASS = BLOCKS.register("glow_pink_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.PINK, Block.Properties.create(Material.GLASS, DyeColor.PINK)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_GRAY_STAINED_GLASS = BLOCKS.register("glow_gray_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.GRAY, Block.Properties.create(Material.GLASS, DyeColor.GRAY)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_LIGHT_GRAY_STAINED_GLASS = BLOCKS.register("glow_light_gray_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.LIGHT_GRAY, Block.Properties.create(Material.GLASS, DyeColor.LIGHT_GRAY)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_CYAN_STAINED_GLASS = BLOCKS.register("glow_cyan_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.CYAN, Block.Properties.create(Material.GLASS, DyeColor.CYAN)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_PURPLE_STAINED_GLASS = BLOCKS.register("glow_purple_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.PURPLE, Block.Properties.create(Material.GLASS, DyeColor.PURPLE)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_BLUE_STAINED_GLASS = BLOCKS.register("glow_blue_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.BLUE, Block.Properties.create(Material.GLASS, DyeColor.BLUE)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_BROWN_STAINED_GLASS = BLOCKS.register("glow_brown_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.BROWN, Block.Properties.create(Material.GLASS, DyeColor.BROWN)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_GREEN_STAINED_GLASS = BLOCKS.register("glow_green_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.GREEN, Block.Properties.create(Material.GLASS, DyeColor.GREEN)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_RED_STAINED_GLASS = BLOCKS.register("glow_red_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.RED, Block.Properties.create(Material.GLASS, DyeColor.RED)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> GLOW_BLACK_STAINED_GLASS = BLOCKS.register("glow_black_stained_glass",
			() -> new GlowStainedGlassBlock(DyeColor.BLACK, Block.Properties.create(Material.GLASS, DyeColor.BLACK)
					.hardnessAndResistance(0.3F).sound(SoundType.GLASS).notSolid().lightValue(11)));
	
	public static final RegistryObject<Block> PERFORATED_SANDSTONE = BLOCKS.register("perforated_sandstone",
			() -> new PerforatedBlock(Block.Properties.create(Material.ROCK, MaterialColor.SAND).hardnessAndResistance(0.8F)));

	// Container
	public static final RegistryObject<Block> GREEDY_CHEST = BLOCKS.register("greedy_chest",
			() -> new GreedyChestBlock(Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F, 4.0F)
					.sound(SoundType.WOOD).harvestTool(ToolType.AXE).harvestLevel(0)));

	public static final RegistryObject<Block> CRATE = BLOCKS.register("crate",
			() -> new CrateBlock(Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F, 4.0F)
					.sound(SoundType.WOOD).harvestTool(ToolType.AXE).harvestLevel(0)));
	
	public static final RegistryObject<Block> CORPSE_OF_AN_UNKNOWN_TRAVELER = BLOCKS.register("corpse_of_an_unknown_traveler",
			() -> new CorpseOfAnUnknownTravelerBlock(Block.Properties.create(Material.SHULKER).hardnessAndResistance(3.0F, 6.0F)
					.sound(ModSoundTypes.SKELETON).harvestTool(ToolType.SHOVEL).harvestLevel(0)));

	// Tree
	public static final RegistryObject<Block> LAUREL_LOG = BLOCKS.register("laurel_log",
			() -> new ModLogBlock(MaterialColor.WOOD, Block.Properties.from(Blocks.OAK_LOG)));

	public static final RegistryObject<Block> LAUREL_LEAVES = BLOCKS.register("laurel_leaves",
			() -> new LaurelLeafBlock(Block.Properties.from(Blocks.OAK_LEAVES)));

	public static final RegistryObject<Block> LAUREL_SAPLING = BLOCKS.register("laurel_sapling",
			() -> new ModSaplingBlock(() -> new LaurelTree(), Block.Properties.from(Blocks.OAK_SAPLING)));
}
